Skip to content

Analysis Functionality Parity#61

Merged
kflemin merged 9 commits into
mainfrom
analyses
May 4, 2026
Merged

Analysis Functionality Parity#61
kflemin merged 9 commits into
mainfrom
analyses

Conversation

@kflemin
Copy link
Copy Markdown
Contributor

@kflemin kflemin commented Apr 3, 2026

Complete Analyses Feature Parity

Closes the remaining gaps between the original AngularJS analyses UI and the Angular v20 port.

Create Analysis — Wired Up

  • Inventory detail Analyses tab: "Create Analysis" button now opens the AnalysisRunModalComponent with the current
    property view ID. Previously was a console.log stub.
  • Property detail Actions dropdown: "Run Analysis" menu item enabled (was disabled with tempAction placeholder). Opens
    the same modal.

HVAC Metrics — New Analysis Type

  • Added 'HVAC Metrics' to AnalysisServiceType union
  • New HvacConfigComponent with floor area column selector (filtered by data_type === 'area')
  • Wired into the analysis-run-modal alongside BETTER and simple configs
  • Added description text to AnalysisService.getAnalysisDescription()

Role-Based Visibility

  • Analyses grid: start/stop/delete action icons hidden when org_role === 'viewer'
  • Inventory detail: "Create Analysis" button hidden for viewers
  • Follows existing pattern (UserService.currentUser$ → org_role check)

UI Polish

  • Renamed "Group Name" → "Analysis Name" in the run modal
  • Updated status cell colors: Completed #198754, Failed #dc3545 (both grid and detail pages)
  • Added setTimeout wrapper to suppress ExpressionChangedAfterItHasBeenCheckedError
  • Updated Translations

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes feature parity for the Analyses UI by wiring up “Run/Create Analysis” actions to the existing run modal, adding a new “HVAC Metrics” analysis configuration, and aligning UI behavior/appearance (role-based visibility and status styling) with the legacy AngularJS implementation.

Changes:

  • Wire “Create Analysis” / “Run Analysis” actions to open AnalysisRunModalComponent with the current org + view context.
  • Add the new “HVAC Metrics” analysis type, including a dedicated config component and service description.
  • Update viewer-role UI visibility, status styling, and i18n strings.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/app/modules/inventory/actions/analysis-run-modal.component.ts Adds HVAC config component support and registers new service type option.
src/app/modules/inventory/actions/analysis-run-modal.component.html Renames “Group Name” label and renders HVAC config UI when selected.
src/app/modules/inventory/actions/analysis-config/index.ts Exports the new HVAC config component.
src/app/modules/inventory/actions/analysis-config/hvac-config.component.ts New config form to select a floor area column for HVAC Metrics.
src/app/modules/inventory/actions/analysis-config/hvac-config.component.html New HVAC Metrics config UI (floor area column selector).
src/app/modules/inventory-detail/detail/header.component.ts Enables “Run Analysis” action and opens the run modal from the detail header.
src/app/modules/inventory-detail/analyses/analyses.component.ts Wires “Create Analysis” button to run modal and hides it for viewers.
src/app/modules/inventory-detail/analyses/analyses.component.html Hides the page action/button for viewer role.
src/app/modules/analyses/analysis/analysis.component.ts Updates status cell styling for Completed/Failed.
src/@seed/components/analyses/analyses-grid.component.ts Updates status styling and hides action icons for viewer role.
src/@seed/api/analysis/analysis.types.ts Extends AnalysisServiceType to include “HVAC Metrics”.
src/@seed/api/analysis/analysis.service.ts Adds description text for the new HVAC Metrics analysis type.
public/i18n/fr_CA.json Adds new translation keys and updates existing strings.
public/i18n/es.json Adds new translation keys and updates existing strings.
public/i18n/en_US.json Adds new translation keys and updates existing strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/@seed/components/analyses/analyses-grid.component.ts Outdated
Comment thread src/@seed/components/analyses/analyses-grid.component.ts
Comment thread src/app/modules/inventory-detail/analyses/analyses.component.ts
Comment thread public/i18n/en_US.json Outdated
Comment thread public/i18n/es.json Outdated
Comment thread public/i18n/fr_CA.json Outdated
kflemin and others added 3 commits April 3, 2026 16:28
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/@seed/components/analyses/analyses-grid.component.ts Outdated
Comment on lines +61 to 65
// Defer to avoid ExpressionChangedAfterItHasBeenCheckedError in LoadingBarComponent
setTimeout(() => {
this.watchAnalyses()
})
}),
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setTimeout can schedule watchAnalyses() to run after ngOnDestroy. Because _unsubscribeAll$ is a plain Subject, any takeUntil(this._unsubscribeAll$) created after destroy will not see the earlier .next() emission and won’t auto-unsubscribe, which can leave a live subscription behind. Avoid deferring subscription setup with setTimeout, or switch _unsubscribeAll$ to a ReplaySubject(1) / takeUntilDestroyed, and/or store and clear the timeout in ngOnDestroy.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit d04391a. Changed _unsubscribeAll$ from Subject<void> to ReplaySubject<void>(1). Now if the setTimeout fires after ngOnDestroy, the ReplaySubject replays the stored .next() emission to any late takeUntil subscriber (including those created inside watchAnalyses()), causing them to complete immediately instead of leaking.

Comment thread src/app/modules/inventory-detail/analyses/analyses.component.ts
Comment thread src/app/modules/inventory-detail/analyses/analyses.component.ts Outdated
kflemin and others added 2 commits May 1, 2026 16:08
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot finished work on behalf of kflemin May 1, 2026 22:16
@kflemin kflemin merged commit f841121 into main May 4, 2026
2 checks passed
@kflemin kflemin deleted the analyses branch May 4, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants